package com.wondertek.mist.utils;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.DialogInterface.OnClickListener;

public class DialogHelper {

	public static void showToastCanceledOnTouchOutside(final Context ctx,String title,String msg) {
		if(StringUtils.isEmpty(title)) {
			title = "提示";
		}
		
		final Dialog dialog = new AlertDialog.Builder(ctx).setTitle(title).setIcon(android.R.drawable.ic_menu_info_details)
		.setMessage(msg)
		.setPositiveButton("确定",new OnClickListener() {
			@Override
			public void onClick(DialogInterface dialog, int which) {
				dialog.dismiss();
				Intent intent = new Intent("android.settings.WIRELESS_SETTINGS");  
				ctx.startActivity(intent);
				android.os.Process.killProcess(android.os.Process.myPid());
			}
		}).create();
		dialog.setCanceledOnTouchOutside(false);
		dialog.show();
	}
	
}
